package com.myproj.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.myproj.dao.EmployeeDao;
import com.myproj.model.Employees;
import com.myproj.service.EmpService;

@Service
public class EmpserviceImpl implements EmpService {
	@Autowired
	private EmployeeDao empdao;

	@Override
	public Boolean empLogin(String ename, String  lastname) {
		Employees emp = empdao.elogin(ename, lastname);
		if (emp != null) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public String findAll() {
		List<Employees> list = empdao.findEmployees();
		return JSON.toJSONString(list);
	}
}
